export const ButtonSettersSchema = {
  children: {
    title: '按钮文字',
    type: 'string',
    'x-decorator': 'FormItem',
    'x-component': 'Input',
    'x-component-props': {
      defaultValue: 'Button',
    },
  },
  accessKey: {
    type: 'string',
    'x-decorator': 'FormItem',
    'x-component': 'Input.TextArea',
    title: '权限标识',
  },
  usePopconfirm: {
    type: 'boolean',
    'x-decorator': 'FormItem',
    'x-component': 'Switch',
    title: '启用确认框',
  },
  popconfirmTitle: {
    type: 'string',
    'x-decorator': 'FormItem',
    'x-component': 'Input.TextArea',
    'x-component-props': {
      defaultValue: '确定要执行该操作吗？',
    },
    title: '确认文案',
    'x-reactions': {
      dependencies: ['.usePopconfirm'],
      fulfill: {
        state: {
          visible: '{{$deps[0] === true}}',
        },
      },
    },
  },
  type: {
    type: 'string',
    'x-decorator': 'FormItem',
    'x-component': 'Select',
    title: '按钮类型',
    'x-component-props': {
      defaultValue: 'default',
      options: [
        { label: '默认', value: 'default' },
        { label: '主要', value: 'primary' },
        { label: '虚线', value: 'dashed' },
        { label: '文本', value: 'text' },
        { label: '链接', value: 'link' },
      ],
    },
  },
  disabled: {
    type: 'boolean',
    'x-decorator': 'FormItem',
    'x-component': 'Switch',
    title: '禁用',
  },
  visible: {
    type: 'boolean',
    'x-decorator': 'FormItem',
    'x-component': 'ExpressionDialogSetter',
    title: '隐藏',
  },
  dialog: {
    type: 'string',
    'x-decorator': 'FormItem',
    'x-component': 'Select',
    'x-component-props': {
      options: '{{getDialogList()}}',
      allowClear: true,
    },
    title: '选择弹窗',
  },
  size: {
    type: 'string',
    enum: ['large', 'middle', 'small'],
    'x-decorator': 'FormItem',
    'x-component': 'Select',
    'x-component-props': {
      defaultValue: 'middle',
    },
    title: '尺寸',
  },
  block: {
    type: 'boolean',
    'x-decorator': 'FormItem',
    'x-component': 'Switch',
    title: '块级按钮',
  },
  shape: {
    type: 'string',
    enum: ['default', 'circle', 'round'],
    'x-decorator': 'FormItem',
    'x-component': 'Select',
    'x-component-props': {
      defaultValue: 'default',
    },
    title: '形状',
  },
  htmlType: {
    type: 'string',
    enum: ['button', 'submit', 'reset'],
    'x-decorator': 'FormItem',
    'x-component': 'Select',
    'x-component-props': {
      defaultValue: 'button',
    },
    title: '原生类型',
  },
  onClickExpression: {
    type: 'string',
    'x-decorator': 'FormItem',
    'x-component': 'ExpressionDialogSetter',
    title: '点击事件',
  },
}
